Software-defined networking (SDN) enables network administrators to manage network services through abstraction of lower-level functionality. Cisco Application Policy Infrastructure Controller Enterprise Module (APIC-EM) is one such SDN solution for enterprise networks, wide area networks (WAN), access networks, etc. APIC-EM is configured to store network information in a network information policy database. One service of APIC-EM is path trace, which can compute the path between two endpoints in the network. Path trace significantly reduces the operating expense (apex) for customers for network troubleshooting. The current state of the art in this area is to use unreliable tools such as trace route and work with insufficient information and spend significant time and effort to determine the right path a 5-tuple flow would take in the network. Path trace on APIC-EM uses the collected data from the network and significantly reduces the time and effort to determine the right path a flow would take in the network. In most cases, it can even eliminate the apex the customer would have to bear to determine accurate paths. One important aspect in computing a path between two endpoints in the network is computing the Layer 2 default gateway for the endpoints. The Layer 2 default gateway is usually configured on the endpoints. Probing the endpoints for gathering the configured default gateway does not scale in certain networks, including enterprise networks, wide area networks (WAN), access networks.